
<template>
  <div class="common-layout">
    <el-container class="app">
        <!-- 左侧列表 -->
         <!-- router启动路由模式 -->
      <el-aside width="200px" >
      <el-menu
        active-text-color="#ffd04b"
        background-color="#545c64"
        class="left-menu"
        default-active="2"
        text-color="#fff"
        router
      >

        <el-menu-item index="/home">
          <el-icon><document /></el-icon>
          <span>首页</span>
        </el-menu-item>

        <el-sub-menu index="1">
          <template #title>
            <el-icon><location /></el-icon>
            <span>商品管理</span>
          </template>
          <!-- 二级菜单 -->
            <el-menu-item index="/prolist"><el-icon><document /></el-icon>商品列表</el-menu-item>
            <el-menu-item index="proadd"><el-icon><document /></el-icon>商品发布</el-menu-item>

          <!-- 三级菜单 -->
          <!-- <el-sub-menu index="1-4">
            <template #title>item four</template>
            <el-menu-item index="1-4-1">item one</el-menu-item>
          </el-sub-menu> -->
        </el-sub-menu>
      </el-menu>
      </el-aside>
      <el-container>
      <el-header>Header</el-header>
      <el-main>
        
        <!-- 右侧主体部分 -->
        <!-- 左侧列表改变，右侧内容改变 -->
        <!-- 配置路由--layout 二级路由 -->
        <router-view></router-view>
      </el-main>
      </el-container>
    </el-container>
  </div>
</template>
  
<script setup lang='ts'>
  
</script>
  
<style scoped lang="scss">
  .left-menu{
    height: 100vh;
  }
  .common-layout{
    height: 100%;
    .app{
      height: 100%;
    }
  }
</style>